<template>
  <div>
    <h1>你好啊</h1>
    <School ref="component"></School>
    <button @click="showDOM" ref="title">点击获取html标签</button>
  </div>
</template>

<script>
import School from "./components/School";
export default {
  components: {
    School,
  },
  methods: {
    showDOM() {
      console.log(this.$refs.title); //真实DOM标签
      console.log(this.$refs.component); //School组件
    },
  },
};
</script>

<style>
</style>